/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.epam.expertsys;

import java.util.Comparator;
import java.lang.IndexOutOfBoundsException;

/**
 *
 * @author Admin
 */
public class FactsValCompare implements Comparator<Integer> {

    @Override
    public int compare(Integer o1, Integer o2) throws IndexOutOfBoundsException {
        FactsKnown Fcts = FactsKnown.getInstance();
        int cmpr = 0;
        try {
            return Fcts.getFact(o1).getVarValue().compareTo(Fcts.getFact(o2).getVarValue());
        } catch (IndexOutOfBoundsException e) {
            throw new IndexOutOfBoundsException("Panic val comparison");
        }

    }
    /* @Override

    public boolean equals(Object o) throws IndexOutOfBoundsException {
    return (compare(this, (Integer)o) == 0);
    }*/
}
